package com.ssn.state.vip;

public class PlatinumVip extends Level {
    PlatinumVip(Level level) {
        score = level.score;
        context = level.context;
        name = "铂金会员";
    }

    @Override
    void buy() {
        System.out.println("当前分数：" + score + "   当前等级：" + context.getLevel().name);
        System.out.println("买东西加分......");
        score += 6;
        checkLevel(this.score);
        System.out.println("当前分数：" + score + "   当前等级：" + context.getLevel().name);
    }

    @Override
    void transfer() {
        System.out.println("当前分数：" + score + "   当前等级：" + context.getLevel().name);
        System.out.println("转账加分......");
        score += 3;
        checkLevel(score);
        System.out.println("当前分数：" + score + "   当前等级：" + context.getLevel().name);
    }

    @Override
    void checkLevel(int score) {
        if (score >= 30) {
            context.setLevel(new DiamondVip(this));
            context.getLevel().level_up = true;
        }
    }

    @Override
    void icon() {
        System.out.println("platinum vip icon");
    }

    @Override
    void menu() {
        System.out.println("platinum vip menu");
    }
}
